From dd8da8f5add1e44b3d0b7a503c8d482c5ea3a51c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 26 May 2017 10:07:29 +0200 Subject: [PATCH] Do not output "Blocking - waiting for lock" with -q This is not an error, so it should not be printed unconditionally to stderr. Since it can appear intermittently (e.g. due to editor integration calling build every now and then) it will disturb things that expect exact output from cargo (e.g. test suites). --- src/cargo/core/shell.rs | 11 +++++++++-- src/cargo/util/flock.rs | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 58ed88f3f..7ec566ac7 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -90,15 +90,22 @@ impl MultiShell { } } - pub fn status(&mut self, status: T, message: U) -> CargoResult<()> + pub fn status_with_color(&mut self, status: T, message: U, color: Color) + -> CargoResult<()> where T: fmt::Display, U: fmt::Display { match self.verbosity { Quiet => Ok(()), - _ => self.err().say_status(status, message, GREEN, true) + _ => self.err().say_status(status, message, color, true) } } + pub fn status(&mut self, status: T, message: U) -> CargoResult<()> + where T: fmt::Display, U: fmt::Display + { + self.status_with_color(status, message, GREEN) + } + pub fn verbose(&mut self, mut callback: F) -> CargoResult<()> where F: FnMut(&mut MultiShell) -> CargoResult<()> { diff --git a/src/cargo/util/flock.rs b/src/cargo/util/flock.rs index 64151bff5..861dd4f73 100644 --- a/src/cargo/util/flock.rs +++ b/src/cargo/util/flock.rs @@ -288,7 +288,7 @@ fn acquire(config: &Config, } } let msg = format!("waiting for file lock on {}", msg); - config.shell().err().say_status("Blocking", &msg, CYAN, true)?; + config.shell().status_with_color("Blocking", &msg, CYAN)?; return block().chain_error(|| { human(format!("failed to lock file: {}", path.display())) -- 2.30.2